measuring volume with unit cubes